<template>
  <div class="nice">
    <h3>演员：{{ userName }}</h3>
    <h3>电影：{{ movieName }}</h3>
    <button @click="sendMovieName">把电影名称传递给父组件App</button>
  </div>
</template>

<script>
export default {
  name: "Movie",
  props: ["getMovieName"],
  data() {
    return {
      userName: "周杰伦",
      movieName: "满城尽带黄金甲",
    };
  },
  methods: {
    sendMovieName() {
      this.getMovieName(this.movieName);
    },
  },
};
</script>

<style>
.nice {
  background-color: green;
}
</style>